package pojo;

public class Customer implements Comparable<Customer>{
   private int id;
   private String name;
   private String sex;
   private String email;
   private String birthday;
   
   
   public Customer(){}
   
  
   
public Customer(int id, String name, String sex, String email, String birthday) {
	super();
	this.id = id;
	this.name = name;
	this.sex = sex;
	this.email = email;
	this.birthday = birthday;
}



public int getId() {
	return id;
}
public void setId(int id) {
	this.id = id;
}
public String getName() {
	return name;
}
public void setName(String name) {
	this.name = name;
}

public String getSex() {
	return sex;
}

public void setSex(String sex) {
	this.sex = sex;
}




public String getEmail() {
	return email;
}



public void setEmail(String email) {
	this.email = email;
}



public String getBirthday() {
	return birthday;
}

public void setBirthday(String birthday) {
	this.birthday = birthday;
}








public int compareTo(Customer o) {
	// TODO Auto-generated method stub
	if(this.id - o.id == 0){
		if(this.name.equals(o.name)){
		if(this.email.equals(o .email)){
		if(this.sex.equals(o.sex)){
		if(this.birthday.equals(o.birthday)){
		return 0;
		}else
		return this.birthday.compareTo(o.birthday);
		}else
		return this.sex.compareTo(o.sex);
		}else
		return this.email.compareTo(o.email);
		}else
		return this.name.compareTo(o.name);
		}
		else
		return this.id - o.id;
}


public String toString(){
	
	return "Customer id="+id+" name="+name+" email="+email+" sex="+sex+" birthday="+birthday;
	
}

   
   
}
